package com.autumn.config.consts;

/**
 * 授权常量
 * 
 * @author 老码农
 *         <p>
 *         Description
 *         </p>
 * @date 2017-12-30 20:50:45
 */
public class AuthorizeRoleConsts {

	/**
	 * 模块代码
	 */
	public static final String MODULE_CODE = "SYS_CONFIG_RES_";

	/**
	 * 后台受权类型
	 */
	public static final String AUTHORIZED_TYPE_BACKSTAGE = "BACKSTAGE";

	/**
	 * 后台的受权
	 */
	public static final String AUTHORIZED_BACKSTAGE = "hasRole('" + AUTHORIZED_TYPE_BACKSTAGE + "') AND ";

	/**
	 * 连接配置
	 * 
	 * @author 老码农
	 *
	 *         2018-01-03 09:15:09
	 */
	public static class ConnectionConfigureConsts {
		/**
		 * 模块代码
		 */
		public static final String CODE = MODULE_CODE + "CONNECTION_";

		private static final String PREFIX = CODE + "EDIT_";

		/**
		 * 连接创建
		 */
		public static final String CREATE = AUTHORIZED_BACKSTAGE + "hasRole('" + PREFIX + "ADD')";

		/**
		 * 连接删除
		 */
		public static final String DELETE = AUTHORIZED_BACKSTAGE + "hasRole('" + PREFIX + "DELETE')";

		/**
		 * 连接修改
		 */
		public static final String UPDATE = AUTHORIZED_BACKSTAGE + "hasRole('" + PREFIX + "MODIFY')";

		/**
		 * 连接查询
		 */
		public static final String QUERY = AUTHORIZED_BACKSTAGE + "hasRole('" + CODE + "QUERY')";

		/**
		 * 更新状态
		 */
		public static final String UPDATE_STATUS = AUTHORIZED_BACKSTAGE + "hasRole('" + CODE + "UPDATE_STATUS')";
	}

	/**
	 * 应用信息
	 * 
	 * @author 老码农
	 *
	 *         2018-01-03 09:15:09
	 */
	public static class ApplicationInfoConsts {
		/**
		 * 模块代码
		 */
		public static final String CODE = MODULE_CODE + "APP_";

		private static final String PREFIX = CODE + "EDIT_";

		/**
		 * 创建
		 */
		public static final String CREATE = AUTHORIZED_BACKSTAGE + "hasRole('" + PREFIX + "ADD')";

		/**
		 * 删除
		 */
		public static final String DELETE = AUTHORIZED_BACKSTAGE + "hasRole('" + PREFIX + "DELETE')";

		/**
		 * 修改
		 */
		public static final String UPDATE = AUTHORIZED_BACKSTAGE + "hasRole('" + PREFIX + "MODIFY')";

		/**
		 * 查询
		 */
		public static final String QUERY = AUTHORIZED_BACKSTAGE + "hasRole('" + CODE + "QUERY')";

		/**
		 * 更新状态
		 */
		public static final String UPDATE_STATUS = AUTHORIZED_BACKSTAGE + "hasRole('" + CODE + "UPDATE_STATUS')";
	}

	/**
	 * 应用连接
	 * 
	 * @author 老码农
	 *
	 *         2018-01-03 09:15:09
	 */
	public static class ApplicationConnectionConsts {
		/**
		 * 模块代码
		 */
		public static final String CODE = MODULE_CODE + "APP_CONNECTION_";

		private static final String PREFIX = CODE + "EDIT_";

		/**
		 * 创建
		 */
		public static final String CREATE = AUTHORIZED_BACKSTAGE + "hasRole('" + PREFIX + "ADD')";

		/**
		 * 删除
		 */
		public static final String DELETE = AUTHORIZED_BACKSTAGE + "hasRole('" + PREFIX + "DELETE')";

		/**
		 * 修改
		 */
		public static final String UPDATE = AUTHORIZED_BACKSTAGE + "hasRole('" + PREFIX + "MODIFY')";

		/**
		 * 查询
		 */
		public static final String QUERY = AUTHORIZED_BACKSTAGE + "hasRole('" + CODE + "QUERY')";

		/**
		 * 更新状态
		 */
		public static final String UPDATE_STATUS = AUTHORIZED_BACKSTAGE + "hasRole('" + CODE + "UPDATE_STATUS')";
	}
	
	/**
	 * 应用配置
	 * 
	 * @author 老码农
	 *
	 *         2018-01-03 09:15:09
	 */
	public static class ApplicationProfileConsts {
		/**
		 * 模块代码
		 */
		public static final String CODE = MODULE_CODE + "APP_PROFILE_";

		private static final String PREFIX = CODE + "EDIT_";

		/**
		 * 创建
		 */
		public static final String CREATE = AUTHORIZED_BACKSTAGE + "hasRole('" + PREFIX + "ADD')";

		/**
		 * 删除
		 */
		public static final String DELETE = AUTHORIZED_BACKSTAGE + "hasRole('" + PREFIX + "DELETE')";

		/**
		 * 修改
		 */
		public static final String UPDATE = AUTHORIZED_BACKSTAGE + "hasRole('" + PREFIX + "MODIFY')";

		/**
		 * 查询
		 */
		public static final String QUERY = AUTHORIZED_BACKSTAGE + "hasRole('" + CODE + "QUERY')";

		/**
		 * 更新状态
		 */
		public static final String UPDATE_STATUS = AUTHORIZED_BACKSTAGE + "hasRole('" + CODE + "UPDATE_STATUS')";
	}
	
	/**
	 * 应用数据源
	 * 
	 * @author 老码农
	 *
	 *         2018-01-03 09:15:09
	 */
	public static class ApplicationDataSourceConsts {
		/**
		 * 模块代码
		 */
		public static final String CODE = MODULE_CODE + "APP_DATA_SOURCE_";

		private static final String PREFIX = CODE + "EDIT_";

		/**
		 * 创建
		 */
		public static final String CREATE = AUTHORIZED_BACKSTAGE + "hasRole('" + PREFIX + "ADD')";

		/**
		 * 删除
		 */
		public static final String DELETE = AUTHORIZED_BACKSTAGE + "hasRole('" + PREFIX + "DELETE')";

		/**
		 * 修改
		 */
		public static final String UPDATE = AUTHORIZED_BACKSTAGE + "hasRole('" + PREFIX + "MODIFY')";

		/**
		 * 查询
		 */
		public static final String QUERY = AUTHORIZED_BACKSTAGE + "hasRole('" + CODE + "QUERY')";

		/**
		 * 更新状态
		 */
		public static final String UPDATE_STATUS = AUTHORIZED_BACKSTAGE + "hasRole('" + CODE + "UPDATE_STATUS')";
	}
}
